home *** CD-ROM | disk | FTP | other *** search
- package views
- {
- import flash.accessibility.*;
- import flash.debugger.*;
- import flash.display.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import mx.binding.*;
- import mx.containers.Canvas;
- import mx.controls.Image;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.PropertyChangeEvent;
- import mx.styles.*;
-
- public class Spread extends Canvas
- {
- private static var _watcherSetupUtil:IWatcherSetupUtil;
-
- private var _bindings:Array;
-
- public var _bindingsByDestination:Object;
-
- public var _bindingsBeginWithWord:Object;
-
- [Bindable]
- private var _859611628imageURL:String;
-
- [Bindable]
- private var _1302779216spreadImg:Image;
-
- private var mxHeight:int = 934;
-
- private var mxWidth:int = 1280;
-
- private var _watchers:Array;
-
- [Bindable]
- private var _94852023cover:int = 0;
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- public function Spread()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":Canvas,
- "propertiesFactory":function():Object
- {
- return {"childDescriptors":[new UIComponentDescriptor({
- "type":Image,
- "id":"spreadImg",
- "events":{"init":"__spreadImg_init"},
- "propertiesFactory":function():Object
- {
- return {
- "showBusyCursor":true,
- "percentWidth":100,
- "percentHeight":100
- };
- }
- })]};
- }
- });
- _94852023cover = 0;
- mxWidth = 1280;
- mxHeight = 934;
- super();
- mx_internal::_document = this;
- if(!this.styleDeclaration)
- {
- this.styleDeclaration = new CSSStyleDeclaration();
- }
- this.styleDeclaration.defaultFactory = function():void
- {
- this.horizontalCenter = 0;
- this.verticalCenter = 0;
- };
- this.percentWidth = 97;
- this.percentHeight = 97;
- }
-
- public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
- {
- Spread._watcherSetupUtil = param1;
- }
-
- public function set imageURL(param1:String) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._859611628imageURL;
- if(_loc2_ !== param1)
- {
- this._859611628imageURL = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"imageURL",_loc2_,param1));
- }
- }
-
- private function imageInit(param1:Event) : void
- {
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:Number = NaN;
- var _loc5_:Number = NaN;
- var _loc6_:int = 0;
- var _loc7_:int = 0;
- var _loc8_:int = 0;
- var _loc9_:int = 0;
- if(0 == cover)
- {
- this.width = mxWidth;
- this.height = mxHeight;
- }
- else
- {
- this.width = mxWidth * 0.97;
- this.height = mxHeight * 0.97;
- }
- _loc2_ = int(param1.target.contentWidth);
- _loc3_ = int(param1.target.contentHeight);
- _loc4_ = this.width / _loc2_;
- _loc5_ = this.height / _loc3_;
- if(_loc4_ < _loc5_)
- {
- _loc6_ = _loc4_ * _loc2_;
- _loc7_ = _loc4_ * _loc3_;
- }
- else
- {
- _loc6_ = _loc5_ * _loc2_;
- _loc7_ = _loc5_ * _loc3_;
- }
- _loc8_ = (this.width - _loc6_) / 2;
- _loc9_ = (this.height - _loc7_) / 2;
- param1.target.x = _loc8_;
- param1.target.y = _loc9_;
- }
-
- [Bindable(event="propertyChange")]
- public function get spreadImg() : Image
- {
- return this._1302779216spreadImg;
- }
-
- private function _Spread_bindingsSetup() : void
- {
- var binding:Binding = null;
- if(!_bindings)
- {
- _bindings = [];
- }
- if(!_watchers)
- {
- _watchers = [];
- }
- binding = new Binding(this,function():Array
- {
- return [new GlowFilter(0,1,12,10,1,2)];
- },function(param1:Array):void
- {
- spreadImg.filters = param1;
- },"spreadImg.filters");
- _bindings[0] = binding;
- binding = new Binding(this,function():Object
- {
- return "images/large/" + imageURL;
- },function(param1:Object):void
- {
- spreadImg.source = param1;
- },"spreadImg.source");
- _bindings[1] = binding;
- }
-
- private function _Spread_bindingExprs() : void
- {
- var _loc1_:* = undefined;
- _loc1_ = [new GlowFilter(0,1,12,10,1,2)];
- _loc1_ = "images/large/" + imageURL;
- }
-
- [Bindable(event="propertyChange")]
- public function get imageURL() : String
- {
- return this._859611628imageURL;
- }
-
- public function __spreadImg_init(param1:Event) : void
- {
- imageInit(param1);
- }
-
- public function set spreadImg(param1:Image) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1302779216spreadImg;
- if(_loc2_ !== param1)
- {
- this._1302779216spreadImg = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spreadImg",_loc2_,param1));
- }
- }
-
- public function set cover(param1:int) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._94852023cover;
- if(_loc2_ !== param1)
- {
- this._94852023cover = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"cover",_loc2_,param1));
- }
- }
-
- override public function initialize() : void
- {
- var target:Spread = null;
- var watcherSetupUtilClass:Object = null;
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- _Spread_bindingsSetup();
- target = this;
- if(_watcherSetupUtil == null)
- {
- watcherSetupUtilClass = getDefinitionByName("_views_SpreadWatcherSetupUtil");
- watcherSetupUtilClass["init"](null);
- }
- _watcherSetupUtil.setup(this,function(param1:String):*
- {
- return target[param1];
- },_bindings,_watchers);
- super.initialize();
- }
-
- [Bindable(event="propertyChange")]
- public function get cover() : int
- {
- return this._94852023cover;
- }
- }
- }
-
-